<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Benchmark</title>
    <script type="text/javascript" src="benchmarker.js"></script>
    <script type="text/javascript">
/* <![CDATA[ */
new Benchmarker({
  // this example shows how to define "methods" inside the "setup" block
}, {
  // custom Benchmark options
  atInit: function() {
    var num = parseInt(this.title.replace(/^.*= /, ''));
    this.TEST = num > 0 ? (1).range(num) : [];

    this.t_each = function() {
      this.TEST.each(function(el){});
    };
    this.t_for = function() {
      for (var i = 0, len = this.TEST.length; i < len; i++)
        var q = this.TEST[i];
    };
  },

  // custom Benchmarker options
  summary: 'loops',
  description: '"for" vs Enumerable.each',
  setup: function() {
    $w('0 10 100 1000').each(function(num) {
      var m = {};
      $w('t_each t_for').each(function(func) {
        eval('m["' + func + '"] = function(){ this.' + func + '()}');
      });
      methodSets.push( { name: 'array.length = ' + num, methods: m });
    });
  }
});
/* ]]> */
    </script>
  </head>
  <body>
  </body>
</html>
